<%@ page import="registerallocator.Aluno" %>



<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'nome', 'error')} required">
	<label for="nome">
		<g:message code="aluno.nome.label" default="Nome" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="nome" required="" value="${alunoInstance?.nome}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'matricula', 'error')} required">
	<label for="matricula">
		<g:message code="aluno.matricula.label" default="Matricula" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="matricula" required="" value="${fieldValue(bean: alunoInstance, field: 'matricula')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'ativo', 'error')} ">
	<label for="ativo">
		<g:message code="aluno.ativo.label" default="Ativo" />
		
	</label>
	<g:checkBox name="ativo" value="${alunoInstance?.ativo}" />
</div>

<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'historico', 'error')} required">
	<label for="historico">
		<g:message code="aluno.historico.label" default="Historico" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="historico" name="historico.id" from="${registerallocator.Historico.list()}" optionKey="id" required="" value="${alunoInstance?.historico?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'horarios', 'error')} ">
	<label for="horarios">
		<g:message code="aluno.horarios.label" default="Horarios" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${alunoInstance?.horarios?}" var="h">
    <li><g:link controller="horarioAluno" action="show" id="${h.id}">${h?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="horarioAluno" action="create" params="['aluno.id': alunoInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'horarioAluno.label', default: 'HorarioAluno')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'turmas', 'error')} ">
	<label for="turmas">
		<g:message code="aluno.turmas.label" default="Turmas" />
		
	</label>
	
</div>

